package com.api.gbhg.hzz;

import com.alibaba.fastjson.JSON;
import com.api.gbhg.lbj.tool.Tools;
import com.api.gbhg.daiyanlu.DataPrintCopyUtil.FormatUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import weaver.conn.RecordSet;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *拱北海关 -> 报阅审批表 or (年度增订)
 *@author hzz
 *@date 2020/12/29
 */
@Path("/gb/subscribe")
public class SubScribeContorller {

    Log log = LogFactory.getLog(SubScribeContorller.class);

    /**
     *报阅审批明细列表查询
     *@author hzz
     *@date 2020/12/29
     */
    @POST
    @Path("/qrySubInfo")
    @Produces(MediaType.TEXT_PLAIN)
    public String qrySubScribeInfo(@Context HttpServletRequest request, @Context HttpServletResponse response){
        log.info("------------------------进入SubScribeContorller中的qrySubScribeInfo方法！！-------------------------------");

        String requestId  = request.getParameter("requestId");
        Map<String,Object> map = new HashMap<>();
        if(requestId.isEmpty()){
            log.info("上送参数为必填参数！！");
            map.put("retcode","-1");
            map.put("retmsg","请检查上送参数！为必填项");
            return JSON.toJSONString(map);
        }
        String str = "";
        if(!requestId.isEmpty()&&requestId!=null){
            str = "and t.requestId in ("+requestId+")" ;
        }

        String sql= "select * from (" +
                "select tbz.*,dt2.yszje,dt3.zcygs36rysg,dt3.zcygs5ryxg,dt3.zcygs615rg,dt3.zcygs1625rg,dt3.zcygs2635rg,dt3.ylbdwdzg,dt3.cjldgbsjdyyysjxdccdzjgwyxgwyfs,ROW_NUMBER() OVER (ORDER BY tbz.id DESC) as RowNumber from (" +
                "select t1.id,t.xmmin,t.sbdw,t.sbks,t.jbr,t1.zfcgyswy,t.lcjlsqjlid,t1.hwgz,t1.gc,t1.fw,t1.xecg from uf_jingfei_version t,uf_gbhgbkdyspb t1 where t.lcjlsqjlid = t1.requestId " + str + ") tbz " +
                //" left join uf_gbhgbkdyspb_dt1 dt1 on dt1.mainid = tbz.id" +
                " left join (select mainid,sum(hjwy)yszje from uf_gbhgbkdyspb_dt2 group by mainid) dt2 on dt2.mainid = tbz.id" +
                " left join uf_gbhgbkdyspb_dt3 dt3 on dt3.mainid = tbz.id" +
                ") tsz ;";
        log.info("拼接后SQL ： " + sql );
        RecordSet rs = new RecordSet();
        rs.executeQuery(sql);
        List<Map<String,Object>> list = new ArrayList<>();
        while(rs.next()){
            Map<String,Object> map1 = new HashMap<>();
            map1.put("xmmin",rs.getString("xmmin"));
            map1.put("sbdw", Tools.getSBDWById(rs.getString("sbdw")));
            map1.put("sbks",Tools.getSBKSById(rs.getString("sbks")));
            map1.put("jbr",Tools.getUserNameById(rs.getString("jbr")));
            map1.put("gc", FormatUtil.DmFormat(rs.getDouble("gc")));
            map1.put("fw",FormatUtil.DmFormat(rs.getDouble("fw")));
            map1.put("lcjlsqjlid",rs.getString("lcjlsqjlid"));
            map1.put("xecg",FormatUtil.DmFormat(rs.getDouble("xecg")));
            map1.put("yszje",FormatUtil.DmFormat(rs.getDouble("yszje")));
            map1.put("zfcgyswy",FormatUtil.DmFormat(rs.getDouble("zfcgyswy")));
            map1.put("hwgz",FormatUtil.DmFormat(rs.getDouble("hwgz")));
            int a=0;
            a=rs.getInt("zcygs5ryxg")+rs.getInt("zcygs615rg")+rs.getInt("zcygs1625rg")+rs.getInt("zcygs2635rg")+rs.getInt("zcygs36rysg");
            map1.put("zcygs36rysg",a);
            map1.put("ylbdwdzg",rs.getString("ylbdwdzg"));
            map1.put("cjldgbsjdyyysjxdccdzjgwyxgwyfs",rs.getString("cjldgbsjdyyysjxdccdzjgwyxgwyfs"));
            //map1.put("je",rs.getString("je"));
            list.add(map1);
        }

        map.put("retcode","0");
        map.put("retmsg","查询成功！");
        map.put("fromTable","uf_gbhgbkdyspb");
        map.put("list",list);
        log.info("======================================="+map.toString());
        return JSON.toJSONString(map);
    }
    //报阅审批明细列表查询
    public String qrySubScribeInfo1(String requestId){
        log.info("------------------------进入SubScribeContorller中的qrySubScribeInfo方法！！-------------------------------");

//        String requestId  = request.getParameter("requestId");
        Map<String,Object> map = new HashMap<>();
        if(requestId.isEmpty()){
            log.info("上送参数为必填参数！！");
            map.put("retcode","-1");
            map.put("retmsg","请检查上送参数！为必填项");
            return JSON.toJSONString(map);
        }
        String str = "";
        if(!requestId.isEmpty()&&requestId!=null){
            str = "and t.requestId in ("+requestId+")" ;
        }

        String sql= "select * from (" +
                "select tbz.*,dt2.yszje,dt3.zcygs36rysg,,dt3.zcygs5ryxg,dt3.zcygs615rg,dt3.zcygs1625rg,dt3.zcygs2635rg,dt3.ylbdwdzg,dt3.cjldgbsjdyyysjxdccdzjgwyxgwyfs,ROW_NUMBER() OVER (ORDER BY tbz.id DESC) as RowNumber from (" +
                "select t1.id,t.xmmin,t.sbdw,t.sbks,t.jbr,t1.zfcgyswy,t.lcjlsqjlid,t1.hwgz,t1.gc,t1.fw,t1.xecg from uf_jingfei_version t,uf_gbhgbkdyspb t1 where t.lcjlsqjlid = t1.requestId " + str + ") tbz " +
                //" left join uf_gbhgbkdyspb_dt1 dt1 on dt1.mainid = tbz.id" +
                " left join (select mainid,sum(hjwy)yszje from uf_gbhgbkdyspb_dt2 group by mainid) dt2 on dt2.mainid = tbz.id" +
                " left join uf_gbhgbkdyspb_dt3 dt3 on dt3.mainid = tbz.id" +
                ") tsz ;";
        log.info("拼接后SQL ： " + sql );
        RecordSet rs = new RecordSet();
        rs.executeQuery(sql);
        List<Map<String,Object>> list = new ArrayList<>();
        while(rs.next()){
            Map<String,Object> map1 = new HashMap<>();
            BigDecimal wan = new BigDecimal("10000");
            BigDecimal gc = new BigDecimal("0.0000");
            BigDecimal fw = new BigDecimal("0.0000");
            BigDecimal xecg = new BigDecimal("0.0000");
            BigDecimal yszje = new BigDecimal("0.0000");
            BigDecimal zfcgyswy = new BigDecimal("0.0000");
            BigDecimal hwgz = new BigDecimal("0.0000");
            if(!rs.getString("gc").equals(" ")){
                gc=gc.add(new BigDecimal(rs.getDouble("gc")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("fw").equals(" ")){
                fw=fw.add(new BigDecimal(rs.getDouble("fw")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("xecg").equals(" ")){
                xecg=xecg.add(new BigDecimal(rs.getDouble("xecg")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("yszje").equals(" ")){
                yszje=yszje.add(new BigDecimal(rs.getDouble("yszje")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("zfcgyswy").equals(" ")){
                zfcgyswy=zfcgyswy.add(new BigDecimal(rs.getDouble("zfcgyswy")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("hwgz").equals(" ")){
                hwgz=hwgz.add(new BigDecimal(rs.getDouble("hwgz")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            map1.put("xmmin",rs.getString("xmmin"));
            map1.put("sbdw", Tools.getSBDWById(rs.getString("sbdw")));
            map1.put("sbks",Tools.getSBKSById(rs.getString("sbks")));
            map1.put("jbr",Tools.getUserNameById(rs.getString("jbr")));
            map1.put("gc", gc);
            map1.put("fw",fw);
            map1.put("lcjlsqjlid",rs.getString("lcjlsqjlid"));
            map1.put("xecg",xecg);
            map1.put("yszje",yszje);
            map1.put("zfcgyswy",zfcgyswy);
            map1.put("hwgz",hwgz);
            int a=0;
            a=rs.getInt("zcygs5ryxg")+rs.getInt("zcygs615rg")+rs.getInt("zcygs1625rg")+rs.getInt("zcygs2635rg")+rs.getInt("zcygs36rysg");
            map1.put("zcygs36rysg",a);
            map1.put("ylbdwdzg",rs.getString("ylbdwdzg"));
            map1.put("cjldgbsjdyyysjxdccdzjgwyxgwyfs",rs.getString("cjldgbsjdyyysjxdccdzjgwyxgwyfs"));
            //map1.put("je",rs.getString("je"));
            list.add(map1);
        }

        map.put("retcode","0");
        map.put("retmsg","查询成功！");
        map.put("fromTable","uf_gbhgbkdyspb");
        map.put("list",list);
        log.info("======================================="+map.toString());
        return JSON.toJSONString(map);
    }

    /**
     *报阅审批 年度增订
     *@author hzz
     *@date 2020/12/30
     */
    @POST
    @Path("/qryAddSubInfo")
    @Produces(MediaType.TEXT_PLAIN)
    public String qryAddSubScribeInfo(@Context HttpServletRequest request , @Context HttpServletResponse response){
        log.info("------------------------进入SubScribeContorller中的qryAddSubScribeInfo方法！！-------------------------------");
        String requestId  = request.getParameter("requestId");
        Map<String,Object> map = new HashMap<>();
        if(requestId.isEmpty()){
            log.info("上送参数为必填参数！！");
            map.put("retcode","-1");
            map.put("retmsg","请检查上送参数！为必填项");
            return JSON.toJSONString(map);
        }
        String str = "";
        if(!requestId.isEmpty()&&requestId!=null)
            str = "and t.requestId in ("+requestId+")" ;

        String sql= "select * from " +
                " (select tbz.*,dt1.dys,dt1.jf,dt1.bgsshs,ROW_NUMBER() OVER (ORDER BY tbz.id DESC) as RowNumber from " +
                " (select t1.id,t.xmmin,t1.bkmc,dt.sbdw,t.sbks,t.jbr,t.yszje,t.lcjlsqjlid,t1.gc,t1.fw,t1.xecg,t1.hwgz,t1.zfcgyswy from uf_jingfei_version t,uf_gbhgbkdyspbndzd t1,uf_gbhgbkdyspbndzd_dt1 dt where t.lcjlsqjlid = t1.requestId " + str + ") tbz " +
                " left join (select mainid,sum(dys) dys,sum(jf) jf,sum(bgsshs) bgsshs from uf_gbhgbkdyspbndzd_dt1 t group by t.mainid) dt1 on dt1.mainid = tbz.id ) tsz ;";


        log.info("拼接后SQL ： " + sql );
        RecordSet rs = new RecordSet();
        rs.executeQuery(sql);
        List<Map<String,Object>> list = new ArrayList<>();
        while(rs.next()){
            Map<String,Object> map1 = new HashMap<>();
            map1.put("xmmin",rs.getString("xmmin"));
            map1.put("sbdw",Tools.getSBDWById(rs.getString("sbdw")));
            map1.put("sbks",Tools.getSBKSById(rs.getString("sbks")));
            map1.put("jbr",Tools.getUserNameById(rs.getString("jbr")));
            map1.put("yszje",FormatUtil.DmFormat(rs.getDouble("yszje")));
            map1.put("gc",FormatUtil.DmFormat(rs.getDouble("gc")));
            map1.put("fw",FormatUtil.DmFormat(rs.getDouble("fw")));
            map1.put("lcjlsqjlid",rs.getString("lcjlsqjlid"));
            map1.put("xecg",FormatUtil.DmFormat(rs.getDouble("xecg")));
            map1.put("hwgz",FormatUtil.DmFormat(rs.getDouble("hwgz")));
            map1.put("zfcgyswy",FormatUtil.DmFormat(rs.getDouble("zfcgyswy")));
            map1.put("dys",rs.getString("dys"));
            map1.put("bkmc",rs.getString("bkmc"));
            map1.put("jf",FormatUtil.DmFormat(rs.getDouble("jf")));
            map1.put("bgsshs",rs.getString("bgsshs"));
            //map1.put("hjwy",rs.getString("hjwy"));
            list.add(map1);
        }

        map.put("retcode","0");
        map.put("retmsg","查询成功！");
        map.put("fromTable","uf_gbhgbkdyspbndzd");
        map.put("list",list);
        log.info("======================================"+map.toString());
        return JSON.toJSONString(map);
    }
    //报阅审批 年度增订
    public String qryAddSubScribeInfo1(String requestId){
        log.info("------------------------进入SubScribeContorller中的qryAddSubScribeInfo方法！！-------------------------------");
        /*String requestId  = request.getParameter("requestId");*/
        Map<String,Object> map = new HashMap<>();
        if(requestId.isEmpty()){
            log.info("上送参数为必填参数！！");
            map.put("retcode","-1");
            map.put("retmsg","请检查上送参数！为必填项");
            return JSON.toJSONString(map);
        }
        String str = "";
        if(!requestId.isEmpty()&&requestId!=null)
            str = "and t.requestId in ("+requestId+")" ;

//        String sql= "select * from " +
//                " (select tbz.*,dt1.dys,dt1.jf,dt1.bgsshs,ROW_NUMBER() OVER (ORDER BY tbz.id DESC) as RowNumber from " +
//                " (select t1.id,dt.bkmc,t.xmmin,t.sbdw,t.sbks,t.jbr,t.yszje,t.lcjlsqjlid,t1.gc,t1.fw,t1.xecg,t1.hwgz,t1.zfcgyswy from uf_jingfei_version t," +
//                "uf_gbhgbkdyspbndzd t1,uf_gbhgbkdyspbndzd_dt1 dt where t.lcjlsqjlid = t1.requestId " + str + ") tbz " +
//                " left join (select mainid,sum(dys) dys,sum(jf) jf,sum(bgsshs) bgsshs from uf_gbhgbkdyspbndzd_dt1 t group by t.mainid) dt1 on dt1.mainid = tbz.id ) tsz ;";

        String sql= "select dt1.bkmc,jv.xmmin,jv.sbdw,jv.sbks,jv.jbr,jv.yszje,jv.lcjlsqjlid,d.gc,d.fw,d.xecg,d.hwgz,d.zfcgyswy,dt1.dys,dt1.jf,dt1.bgsshs \n" +
                "from uf_jingfei_version jv inner join uf_gbhgbkdyspbndzd d\n" +
                "on jv.requestId = d.requestId inner join uf_gbhgbkdyspbndzd_dt1 dt1\n" +
                "on d.id = dt1.mainid where jv.lcjlsqjlid=d.requestId";


        log.info("拼接后SQL ： " + sql );
        RecordSet rs = new RecordSet();
        rs.executeQuery(sql);
        List<Map<String,Object>> list = new ArrayList<>();
        while(rs.next()){
            Map<String,Object> map1 = new HashMap<>();
            BigDecimal wan = new BigDecimal("10000");
            BigDecimal yszje = new BigDecimal("0.0000");
            BigDecimal gc = new BigDecimal("0.0000");
            BigDecimal fw = new BigDecimal("0.0000");
            BigDecimal xecg = new BigDecimal("0.0000");
            BigDecimal zfcgyswy = new BigDecimal("0.0000");
            BigDecimal hwgz = new BigDecimal("0.0000");
            BigDecimal jf = new BigDecimal("0.0000");
            if(!rs.getString("gc").equals(" ")){
                gc=gc.add(new BigDecimal(rs.getDouble("gc")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("fw").equals(" ")){
                fw=fw.add(new BigDecimal(rs.getDouble("fw")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("xecg").equals(" ")){
                xecg=xecg.add(new BigDecimal(rs.getDouble("xecg")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("yszje").equals(" ")){
                yszje=yszje.add(new BigDecimal(rs.getDouble("yszje")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("zfcgyswy").equals(" ")){
                zfcgyswy=zfcgyswy.add(new BigDecimal(rs.getDouble("zfcgyswy")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("hwgz").equals(" ")){
                hwgz=hwgz.add(new BigDecimal(rs.getDouble("hwgz")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("jf").equals(" ")){
                jf=jf.add(new BigDecimal(rs.getDouble("jf")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            map1.put("xmmin",rs.getString("xmmin"));
            map1.put("sbdw",Tools.getSBDWById(rs.getString("sbdw")));
            map1.put("sbks",Tools.getSBKSById(rs.getString("sbks")));
            map1.put("jbr",Tools.getUserNameById(rs.getString("jbr")));
            map1.put("yszje",yszje);
            map1.put("gc",gc);
            map1.put("fw",fw);
            map1.put("lcjlsqjlid",rs.getString("lcjlsqjlid"));
            map1.put("xecg",xecg);
            map1.put("hwgz",hwgz);
            map1.put("zfcgyswy",zfcgyswy);
            map1.put("dys",rs.getString("dys"));
            map1.put("bkmc",rs.getString("bkmc"));
            map1.put("jf",jf);
            map1.put("bgsshs",rs.getString("bgsshs"));
            //map1.put("hjwy",rs.getString("hjwy"));
            list.add(map1);
        }

        map.put("retcode","0");
        map.put("retmsg","查询成功！");
        map.put("fromTable","uf_gbhgbkdyspbndzd");
        map.put("list",list);
        log.info("======================================="+map.toString());
        return JSON.toJSONString(map);
    }

    //police  allowance  apply
    /**
    *警察津贴补助申请数据接口
    *@author hzz
    *@date 2020/01/05
    */
    @POST
    @Path("/qryPoliceMoneyApply")
    @Produces(MediaType.APPLICATION_JSON)
    @Consumes(MediaType.APPLICATION_JSON)
    public String qryPoliceMoneyApply(Map<String,String> param){
        log.info("------------------------进入SubScribeContorller中的qryAddSubScribeInfo方法！！-------------------------------");

        String requestId = param.get("requestId");
        Map<String,Object> map = new HashMap<>();
        if(requestId.isEmpty()){
            log.info("上送参数为必填参数！！");
            map.put("retcode","-1");
            map.put("retmsg","请检查上送参数！为必填项");
            return JSON.toJSONString(map);
        }
        String str = "";
        if(!requestId.isEmpty()&&requestId!=null)
            str = "and t.requestId in ("+requestId+")" ;
        String sql = "select * from " +
                " (select tbz.*,dt1.hj,dt1.ygzffrs,dt1.zwgz,dt1.jbgz,dt1.sbdw as gzxjt,dt1.jxjt,dt1.nzycxjj,dt1.tqjt,dt1.yxwxnxjbc as wxnjbc,dt1.yxwxnxjbc,dt1.jswmj,dt1.jhsyj,dt1.lsbt,dt1.rmjczqgwjt,dt1.rmjcfdgzrwjbbt,dt1.dsznfmjlf,dt1.shxbt,ROW_NUMBER() OVER (ORDER BY tbz.id DESC) as RowNumber from " +
                " (select t1.id,t.xmmin,t.sbdw,t.sbks,t.jbr,t.yszje,t.lcjlsqjlid from uf_jingfei_version t,uf_jczzxzrygzjtbjfbb t1 where t.lcjlsqjlid = t1.requestId "+ str +") tbz " +
                " left join (select mainid,sum(hj)hj,sum(ygzffrs)ygzffrs,sum(zwgz)zwgz,sum(jbgz)jbgz,sum(sbdw)sbdw,sum(jxjt)jxjt,sum(nzycxjj)nzycxjj,sum(tqjt)tqjt,sum(yxwxnxjbc)wxnjbc,sum(yxwxnxjbc)yxwxnxjbc,\n" +
                "sum(jswmj)jswmj,sum(jhsyj)jhsyj,sum(shxbt)shxbt,sum(lsbt)lsbt,sum(rmjczqgwjt)rmjczqgwjt,sum(rmjcfdgzrwjbbt)rmjcfdgzrwjbbt,sum(dsznfmjlf)dsznfmjlf from uf_jczzxzrygzjtbjfbb_dt1 t group by mainid ) dt1 on dt1.mainid = tbz.id ) tsz ;";

        log.info("拼接后SQL ： " + sql );
        RecordSet rs = new RecordSet();
        rs.executeQuery(sql);
        List<Map<String,Object>> list = new ArrayList<>();
        while(rs.next()){
            Map<String,Object> map1 = new HashMap<>();
            map1.put("xmmin",rs.getString("xmmin"));
            map1.put("sbdw",Tools.getSBDWById(rs.getString("sbdw")));
            map1.put("sbks",Tools.getSBKSById(rs.getString("sbks")));
            map1.put("jbr",Tools.getUserNameById(rs.getString("jbr")));
            map1.put("yszje",FormatUtil.DmFormat(rs.getDouble("yszje")));
            map1.put("hj",FormatUtil.DmFormat(rs.getDouble("hj")));
            map1.put("ygzffrs",rs.getString("ygzffrs"));
            map1.put("zwgz",FormatUtil.DmFormat(rs.getDouble("zwgz")));
            map1.put("jbgz",FormatUtil.DmFormat(rs.getDouble("jbgz")));
            map1.put("gzxjt",FormatUtil.DmFormat(rs.getDouble("gzxjt")));
            map1.put("lcjlsqjlid",rs.getString("lcjlsqjlid"));
            map1.put("jxjt",FormatUtil.DmFormat(rs.getDouble("jxjt")));
            map1.put("nzycxjj",FormatUtil.DmFormat(rs.getDouble("nzycxjj")));
            map1.put("shxbt",rs.getString("shxbt"));
            map1.put("tqjt",FormatUtil.DmFormat(rs.getDouble("tqjt")));
            map1.put("wxnjbc",FormatUtil.DmFormat(rs.getDouble("wxnjbc")));
            map1.put("yxwxnxjbc",FormatUtil.DmFormat(rs.getDouble("yxwxnxjbc")));
            map1.put("jswmj",FormatUtil.DmFormat(rs.getDouble("jswmj")));
            map1.put("jhsyj",FormatUtil.DmFormat(rs.getDouble("jhsyj")));
            map1.put("lsbt",FormatUtil.DmFormat(rs.getDouble("lsbt")));
            map1.put("rmjczqgwjt",FormatUtil.DmFormat(rs.getDouble("rmjczqgwjt")));
            map1.put("rmjcfdgzrwjbbt",FormatUtil.DmFormat(rs.getDouble("rmjcfdgzrwjbbt")));
            map1.put("dsznfmjlf",FormatUtil.DmFormat(rs.getDouble("dsznfmjlf")));
            //map1.put("bmyszcjjfl",rs.getString("bmyszcjjfl"));
            //map1.put("hjwy",rs.getString("hjwy"));
            list.add(map1);
        }
        map.put("retcode","0");
        map.put("retmsg","查询成功！");
        map.put("fromTable","uf_jczzxzrygzjtbjfbb");
        map.put("list",list);
        log.info("======================================="+map.toString());
        return JSON.toJSONString(map);
    }
    //警察在职行政人员工资津贴补贴经费需求表
    public String qryPoliceMoneyApply1(String requestId){
        log.info("------------------------进入SubScribeContorller中的qryAddSubScribeInfo方法！！-------------------------------");

//        String requestId = param.get("requestId");
        Map<String,Object> map = new HashMap<>();
        if(requestId.isEmpty()){
            log.info("上送参数为必填参数！！");
            map.put("retcode","-1");
            map.put("retmsg","请检查上送参数！为必填项");
            return JSON.toJSONString(map);
        }
        String str = "";
        if(!requestId.isEmpty()&&requestId!=null)
            str = "and t.requestId in ("+requestId+")" ;
        String sql = "select * from " +
                " (select tbz.*,dt1.hj,dt1.ygzffrs,dt1.zwgz,dt1.jbgz,dt1.sbdw as gzxjt,dt1.jxjt,dt1.nzycxjj,dt1.tqjt,dt1.yxwxnxjbc as wxnjbc,dt1.yxwxnxjbc,dt1.jswmj,dt1.jhsyj,dt1.lsbt,dt1.rmjczqgwjt,dt1.rmjcfdgzrwjbbt,dt1.dsznfmjlf,dt1.shxbt,ROW_NUMBER() OVER (ORDER BY tbz.id DESC) as RowNumber from " +
                " (select t1.id,t.xmmin,t.sbdw,t.sbks,t.jbr,t.yszje,t.lcjlsqjlid from uf_jingfei_version t,uf_jczzxzrygzjtbjfbb t1 where t.lcjlsqjlid = t1.requestId "+ str +") tbz " +
                " left join (select mainid,sum(hj)hj,sum(ygzffrs)ygzffrs,sum(zwgz)zwgz,sum(jbgz)jbgz,sum(sbdw)sbdw,sum(jxjt)jxjt,sum(nzycxjj)nzycxjj,sum(tqjt)tqjt,sum(yxwxnxjbc)wxnjbc,sum(yxwxnxjbc)yxwxnxjbc,\n" +
                "sum(jswmj)jswmj,sum(jhsyj)jhsyj,sum(shxbt)shxbt,sum(lsbt)lsbt,sum(rmjczqgwjt)rmjczqgwjt,sum(rmjcfdgzrwjbbt)rmjcfdgzrwjbbt,sum(dsznfmjlf)dsznfmjlf from uf_jczzxzrygzjtbjfbb_dt1 t group by mainid ) dt1 on dt1.mainid = tbz.id ) tsz ;";

        log.info("拼接后SQL ： " + sql );
        RecordSet rs = new RecordSet();
        rs.executeQuery(sql);
        List<Map<String,Object>> list = new ArrayList<>();
        while(rs.next()){
            Map<String,Object> map1 = new HashMap<>();
            BigDecimal wan = new BigDecimal("10000");
            BigDecimal yszje = new BigDecimal("0.0000");
            BigDecimal hj = new BigDecimal("0.0000");
            BigDecimal zwgz = new BigDecimal("0.0000");
            BigDecimal jbgz = new BigDecimal("0.0000");
            BigDecimal gzxjt = new BigDecimal("0.0000");
            BigDecimal jxjt = new BigDecimal("0.0000");
            BigDecimal tqjt = new BigDecimal("0.0000");
            BigDecimal wxnjbc = new BigDecimal("0.0000");
            BigDecimal yxwxnxjbc = new BigDecimal("0.0000");
            BigDecimal jswmj = new BigDecimal("0.0000");
            BigDecimal jhsyj = new BigDecimal("0.0000");
            BigDecimal lsbt = new BigDecimal("0.0000");
            BigDecimal rmjczqgwjt = new BigDecimal("0.0000");
            BigDecimal rmjcfdgzrwjbbt = new BigDecimal("0.0000");
            BigDecimal dsznfmjlf = new BigDecimal("0.0000");
            BigDecimal nzycxjj = new BigDecimal("0.0000");
            BigDecimal shxbt = new BigDecimal("0.0000");
            if(!rs.getString("shxbt").equals(" ")){
                shxbt=shxbt.add(new BigDecimal(rs.getDouble("shxbt")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("hj").equals(" ")){
                hj=hj.add(new BigDecimal(rs.getDouble("hj")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("zwgz").equals(" ")){
                zwgz=zwgz.add(new BigDecimal(rs.getDouble("zwgz")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("jbgz").equals(" ")){
                jbgz=jbgz.add(new BigDecimal(rs.getDouble("jbgz")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("yszje").equals(" ")){
                yszje=yszje.add(new BigDecimal(rs.getDouble("yszje")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("gzxjt").equals(" ")){
                gzxjt=gzxjt.add(new BigDecimal(rs.getDouble("gzxjt")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("jxjt").equals(" ")){
                jxjt=jxjt.add(new BigDecimal(rs.getDouble("jxjt")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("tqjt").equals(" ")){
                tqjt=tqjt.add(new BigDecimal(rs.getDouble("tqjt")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("wxnjbc").equals(" ")){
                wxnjbc=wxnjbc.add(new BigDecimal(rs.getDouble("wxnjbc")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("yxwxnxjbc").equals(" ")){
                yxwxnxjbc=yxwxnxjbc.add(new BigDecimal(rs.getDouble("yxwxnxjbc")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("jswmj").equals(" ")){
                jswmj=jswmj.add(new BigDecimal(rs.getDouble("jswmj")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("jhsyj").equals(" ")){
                jhsyj=jhsyj.add(new BigDecimal(rs.getDouble("jhsyj")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("lsbt").equals(" ")){
                lsbt=lsbt.add(new BigDecimal(rs.getDouble("lsbt")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("rmjczqgwjt").equals(" ")){
                rmjczqgwjt=rmjczqgwjt.add(new BigDecimal(rs.getDouble("rmjczqgwjt")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("rmjcfdgzrwjbbt").equals(" ")){
                rmjcfdgzrwjbbt=rmjcfdgzrwjbbt.add(new BigDecimal(rs.getDouble("rmjcfdgzrwjbbt")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("dsznfmjlf").equals(" ")){
                dsznfmjlf=dsznfmjlf.add(new BigDecimal(rs.getDouble("dsznfmjlf")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("nzycxjj").equals(" ")){
                nzycxjj=nzycxjj.add(new BigDecimal(rs.getDouble("nzycxjj")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            map1.put("xmmin",rs.getString("xmmin"));
            map1.put("sbdw",Tools.getSBDWById(rs.getString("sbdw")));
            map1.put("sbks",Tools.getSBKSById(rs.getString("sbks")));
            map1.put("jbr",Tools.getUserNameById(rs.getString("jbr")));
            map1.put("yszje",yszje);
            map1.put("hj",hj);
            map1.put("ygzffrs",rs.getString("ygzffrs"));
            map1.put("zwgz",zwgz);
            map1.put("jbgz",jbgz);
            map1.put("gzxjt",gzxjt);
            map1.put("lcjlsqjlid",rs.getString("lcjlsqjlid"));
            map1.put("jxjt",jxjt);
            map1.put("nzycxjj",nzycxjj);
            map1.put("shxbt",shxbt);
            map1.put("tqjt",tqjt);
            map1.put("wxnjbc",wxnjbc);
            map1.put("yxwxnxjbc",yxwxnxjbc);
            map1.put("jswmj",jswmj);
            map1.put("jhsyj",jhsyj);
            map1.put("lsbt",lsbt);
            map1.put("rmjczqgwjt",rmjczqgwjt);
            map1.put("rmjcfdgzrwjbbt",rmjcfdgzrwjbbt);
            map1.put("dsznfmjlf",dsznfmjlf);
            //map1.put("bmyszcjjfl",rs.getString("bmyszcjjfl"));
            //map1.put("hjwy",rs.getString("hjwy"));
            list.add(map1);
        }
        map.put("retcode","0");
        map.put("retmsg","查询成功！");
        map.put("fromTable","uf_jczzxzrygzjtbjfbb");
        map.put("list",list);
        log.info("======================================="+map.toString());
        return JSON.toJSONString(map);
    }


    /**
     *住房改革支出经费数据接口
     *@author hzz
     *@date 2020/01/05
     */
    @POST
    @Path("/qryHousingInfo")
    @Produces(MediaType.APPLICATION_JSON)
    @Consumes(MediaType.APPLICATION_JSON)
    public String qryHousingInfo(Map<String,String> param){
        log.info("------------------------进入SubScribeContorller中的qryHousingInfo方法！！-------------------------------");
       /* //当前页
        String pageNum = param.get("pageNum");
        //分页页数
        String pageSize = param.get("pageSize");
        //状态  3 已审批  非3 未审批
        String status = param.get("status");
        Map<String,Object> map = new HashMap<>();
        log.info("params:pageNum=" + pageNum + "--pageSize=" + pageSize + "--status="+ status);
        if(pageNum.isEmpty() || pageSize.isEmpty() || status.isEmpty()){
            log.info("上送参数为必填参数！！");
            map.put("retcode","-1");
            map.put("retmsg","请检查上送参数！为必填项");
            return JSON.toJSONString(map);
        }
        String str = "";
        if(status.equals("3")){
            str = "and t.lcztz = 3" ;
        }else {
            str = "and t.lcztz <> 3" ;
        }
        Integer begNum = 0;
        Integer fectNUm = 0;
        if(pageNum.equals("1")){
            begNum = Integer.parseInt(pageNum) ;
            fectNUm = Integer.parseInt(pageSize) ;
        }else {
            begNum = Integer.parseInt(pageNum) * Integer.parseInt(pageSize) - Integer.parseInt(pageSize) + 1;
            fectNUm = Integer.parseInt(pageNum) * Integer.parseInt(pageSize) ;
        }
        log.info("begNum:"+ begNum + "----------fectNum:"+ fectNUm);
        String sql = "select * from\n" +
                " (select tbz.*,dt1.zfgjjys,dt1.zfggbtys,dt1.je,dt2.hjwy,dt2.czbkwy,dt2.jzzjwy,ROW_NUMBER() OVER (ORDER BY tbz.id DESC) as RowNumber from \n" +
                " (select t1.id,t.lcjlsqjlid,t.xmmin,t.sbdw,t.sbks,t.jbr,t.yszje,t1.gc,t1.fw,t1.xecg,t1.hwgz,t1.zfcgyswy from uf_jingfei_version t,uf_zfggzcjfxqb t1 where t.lcjlsqjlid = t1.requestId " + str + ") tbz \n" +
                " left join (select t.mainid,sum(t.zfgjjys)zfgjjys,sum(t.zfggbtys)zfggbtys,sum(t.je)je from uf_zfggzcjfxqb_dt1 t group by t.mainid) dt1 on dt1.mainid = tbz.id\n" +
                " left join (select t.mainid,sum(t.hjwy)hjwy,sum(t.czbkwy)czbkwy,sum(t.jzzjwy)jzzjwy from uf_zfggzcjfxqb_dt2 t group by t.mainid) dt2 on dt2.mainid = tbz.id\n" +
                " ) tsz where RowNumber BETWEEN "+ begNum +" AND " + fectNUm + ";";*/
        String requestId = param.get("requestId");
        Map<String,Object> map = new HashMap<>();
        if(requestId.isEmpty()){
            log.info("上送参数为必填参数！！");
            map.put("retcode","-1");
            map.put("retmsg","请检查上送参数！为必填项");
            return JSON.toJSONString(map);
        }
        String str = "";
        if(!requestId.isEmpty()&&requestId!=null)
            str = "and t.requestId in ("+requestId+")" ;
        String sql = "select * from\n" +
                " (select tbz.*,dt1.zfgjjys,dt1.zfggbtys,dt1.je,dt2.hjwy,dt2.czbkwy,dt2.jzzjwy,ROW_NUMBER() OVER (ORDER BY tbz.id DESC) as RowNumber from \n" +
                " (select t1.id,t.lcjlsqjlid,t.xmmin,t.sbdw,t.sbks,t.jbr,t.yszje,t1.gc,t1.fw,t1.xecg,t1.hwgz,t1.zfcgyswy from uf_jingfei_version t,uf_zfggzcjfxqb t1 where t.lcjlsqjlid = t1.requestId " + str + ") tbz \n" +
                " left join (select t.mainid,sum(t.zfgjjys)zfgjjys,sum(t.zfggbtys)zfggbtys,sum(t.je)je from uf_zfggzcjfxqb_dt1 t group by t.mainid) dt1 on dt1.mainid = tbz.id\n" +
                " left join (select t.mainid,sum(t.hjwy)hjwy,sum(t.czbkwy)czbkwy,sum(t.jzzjwy)jzzjwy from uf_zfggzcjfxqb_dt2 t group by t.mainid) dt2 on dt2.mainid = tbz.id\n" +
                " ) tsz ;";


        log.info("拼接后SQL ： " + sql );
        RecordSet rs = new RecordSet();
        rs.executeQuery(sql);
        List<Map<String,Object>> list = new ArrayList<>();
        while(rs.next()){
            Map<String,Object> map1 = new HashMap<>();
            map1.put("xmmin",rs.getString("xmmin"));
            map1.put("lcjlsqjlid",rs.getString("lcjlsqjlid"));
            map1.put("sbdw",Tools.getSBDWById(rs.getString("sbdw")));
            map1.put("sbks",Tools.getSBKSById(rs.getString("sbks")));
            map1.put("jbr",Tools.getUserNameById(rs.getString("jbr")));
            map1.put("yszje",FormatUtil.DmFormat(rs.getDouble("yszje")));
            map1.put("gc",FormatUtil.DmFormat(rs.getDouble("gc")));
            map1.put("fw",FormatUtil.DmFormat(rs.getDouble("fw")));
            map1.put("xecg",FormatUtil.DmFormat(rs.getDouble("xecg")));
            map1.put("hwgz",FormatUtil.DmFormat(rs.getDouble("hwgz")));
            map1.put("zfgjjys",FormatUtil.DmFormat(rs.getDouble("zfgjjys")));
            map1.put("zfggbtys",FormatUtil.DmFormat(rs.getDouble("zfggbtys")));
            map1.put("je",FormatUtil.DmFormat(rs.getDouble("je")));
            map1.put("hjwy",FormatUtil.DmFormat(rs.getDouble("hjwy")));
            map1.put("czbkwy",FormatUtil.DmFormat(rs.getDouble("czbkwy")));
            map1.put("jzzjwy",FormatUtil.DmFormat(rs.getDouble("jzzjwy")));

            list.add(map1);
        }
       /* String sqlCount = "select count(1) as count from uf_jingfei_version t,uf_zfggzcjfxqb t1 where t.lcjlsqjlid = t1.requestId " + str + ";";
        RecordSet rs2 = new RecordSet();
        rs2.executeQuery(sqlCount);
        rs2.next();
        log.info("查询数量SQL ： " + sql );
        Double total = Double.parseDouble(rs2.getString("count"));
        Double pageSizeDou = Double.parseDouble((pageSize));*/

        map.put("retcode","0");
        map.put("retmsg","查询成功！");
        /*map.put("pageNum",pageNum);
        map.put("pageSize",pageSize);
        map.put("total",Integer.parseInt(rs2.getString("count")));
        map.put("pages",Math.ceil(total/pageSizeDou));*/
        map.put("fromTable","uf_zfggzcjfxqb");
        map.put("list",list);
        log.info("======================================="+map.toString());
        return JSON.toJSONString(map);
    }

    // 17 住房改革支出经费需求表
    public String qryHousingInfo1(String requestId){
        log.info("------------------------进入SubScribeContorller中的qryHousingInfo方法！！-------------------------------");
       /* //当前页
        String pageNum = param.get("pageNum");
        //分页页数
        String pageSize = param.get("pageSize");
        //状态  3 已审批  非3 未审批
        String status = param.get("status");
        Map<String,Object> map = new HashMap<>();
        log.info("params:pageNum=" + pageNum + "--pageSize=" + pageSize + "--status="+ status);
        if(pageNum.isEmpty() || pageSize.isEmpty() || status.isEmpty()){
            log.info("上送参数为必填参数！！");
            map.put("retcode","-1");
            map.put("retmsg","请检查上送参数！为必填项");
            return JSON.toJSONString(map);
        }
        String str = "";
        if(status.equals("3")){
            str = "and t.lcztz = 3" ;
        }else {
            str = "and t.lcztz <> 3" ;
        }
        Integer begNum = 0;
        Integer fectNUm = 0;
        if(pageNum.equals("1")){
            begNum = Integer.parseInt(pageNum) ;
            fectNUm = Integer.parseInt(pageSize) ;
        }else {
            begNum = Integer.parseInt(pageNum) * Integer.parseInt(pageSize) - Integer.parseInt(pageSize) + 1;
            fectNUm = Integer.parseInt(pageNum) * Integer.parseInt(pageSize) ;
        }
        log.info("begNum:"+ begNum + "----------fectNum:"+ fectNUm);
        String sql = "select * from\n" +
                " (select tbz.*,dt1.zfgjjys,dt1.zfggbtys,dt1.je,dt2.hjwy,dt2.czbkwy,dt2.jzzjwy,ROW_NUMBER() OVER (ORDER BY tbz.id DESC) as RowNumber from \n" +
                " (select t1.id,t.lcjlsqjlid,t.xmmin,t.sbdw,t.sbks,t.jbr,t.yszje,t1.gc,t1.fw,t1.xecg,t1.hwgz,t1.zfcgyswy from uf_jingfei_version t,uf_zfggzcjfxqb t1 where t.lcjlsqjlid = t1.requestId " + str + ") tbz \n" +
                " left join (select t.mainid,sum(t.zfgjjys)zfgjjys,sum(t.zfggbtys)zfggbtys,sum(t.je)je from uf_zfggzcjfxqb_dt1 t group by t.mainid) dt1 on dt1.mainid = tbz.id\n" +
                " left join (select t.mainid,sum(t.hjwy)hjwy,sum(t.czbkwy)czbkwy,sum(t.jzzjwy)jzzjwy from uf_zfggzcjfxqb_dt2 t group by t.mainid) dt2 on dt2.mainid = tbz.id\n" +
                " ) tsz where RowNumber BETWEEN "+ begNum +" AND " + fectNUm + ";";*/
//        String requestId = param.get("requestId");
        Map<String,Object> map = new HashMap<>();
        if(requestId.isEmpty()){
            log.info("上送参数为必填参数！！");
            map.put("retcode","-1");
            map.put("retmsg","请检查上送参数！为必填项");
            return JSON.toJSONString(map);
        }
        String str = "";
        if(!requestId.isEmpty()&&requestId!=null)
            str = "and t.requestId in ("+requestId+")" ;
        String sql = "select * from\n" +
                " (select tbz.*,dt1.zfgjjys,dt1.zfggbtys,dt1.je,dt2.hjwy,dt2.czbkwy,dt2.jzzjwy,ROW_NUMBER() OVER (ORDER BY tbz.id DESC) as RowNumber from \n" +
                " (select t1.id,t.lcjlsqjlid,t.xmmin,t.sbdw,t.sbks,t.jbr,t.yszje,t1.gc,t1.fw,t1.xecg,t1.hwgz,t1.zfcgyswy from uf_jingfei_version t,uf_zfggzcjfxqb t1 where t.lcjlsqjlid = t1.requestId " + str + ") tbz \n" +
                " left join (select t.mainid,sum(t.zfgjjys)zfgjjys,sum(t.zfggbtys)zfggbtys,sum(t.je)je from uf_zfggzcjfxqb_dt1 t group by t.mainid) dt1 on dt1.mainid = tbz.id\n" +
                " left join (select t.mainid,sum(t.hjwy)hjwy,sum(t.czbkwy)czbkwy,sum(t.jzzjwy)jzzjwy from uf_zfggzcjfxqb_dt2 t group by t.mainid) dt2 on dt2.mainid = tbz.id\n" +
                " ) tsz ;";


        log.info("拼接后SQL ： " + sql );
        RecordSet rs = new RecordSet();
        rs.executeQuery(sql);
        List<Map<String,Object>> list = new ArrayList<>();
        while(rs.next()){
            Map<String,Object> map1 = new HashMap<>();
            BigDecimal wan = new BigDecimal("10000");
            BigDecimal yszje = new BigDecimal("0.0000");
            BigDecimal gc = new BigDecimal("0.0000");
            BigDecimal fw = new BigDecimal("0.0000");
            BigDecimal xecg = new BigDecimal("0.0000");
            BigDecimal zfgjjys = new BigDecimal("0.0000");
            BigDecimal zfggbtys = new BigDecimal("0.0000");
            BigDecimal je = new BigDecimal("0.0000");
            BigDecimal hjwy = new BigDecimal("0.0000");
            BigDecimal czbkwy = new BigDecimal("0.0000");
            BigDecimal jzzjwy = new BigDecimal("0.0000");
            BigDecimal hwgz = new BigDecimal("0.0000");
            if(!rs.getString("gc").equals(" ")){
                gc=gc.add(new BigDecimal(rs.getDouble("gc")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("fw").equals(" ")){
                fw=fw.add(new BigDecimal(rs.getDouble("fw")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("xecg").equals(" ")){
                xecg=xecg.add(new BigDecimal(rs.getDouble("xecg")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("yszje").equals(" ")){
                yszje=yszje.add(new BigDecimal(rs.getDouble("yszje")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("zfgjjys").equals(" ")){
                zfgjjys=zfgjjys.add(new BigDecimal(rs.getDouble("zfgjjys")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("hwgz").equals(" ")){
                hwgz=hwgz.add(new BigDecimal(rs.getDouble("hwgz")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("zfggbtys").equals(" ")){
                zfggbtys=zfggbtys.add(new BigDecimal(rs.getDouble("zfggbtys")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("je").equals(" ")){
                je=je.add(new BigDecimal(rs.getDouble("je")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("hjwy").equals(" ")){
                hjwy=hjwy.add(new BigDecimal(rs.getDouble("hjwy")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("jzzjwy").equals(" ")){
                jzzjwy=jzzjwy.add(new BigDecimal(rs.getDouble("jzzjwy")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            if(!rs.getString("czbkwy").equals(" ")){
                czbkwy=czbkwy.add(new BigDecimal(rs.getDouble("czbkwy")).divide(wan,4,BigDecimal.ROUND_HALF_UP));
            }
            map1.put("xmmin",rs.getString("xmmin"));
            map1.put("lcjlsqjlid",rs.getString("lcjlsqjlid"));
            map1.put("sbdw",Tools.getSBDWById(rs.getString("sbdw")));
            map1.put("sbks",Tools.getSBKSById(rs.getString("sbks")));
            map1.put("jbr",Tools.getUserNameById(rs.getString("jbr")));
            map1.put("yszje",yszje);
            map1.put("gc",gc);
            map1.put("fw",fw);
            map1.put("xecg",xecg);
            map1.put("hwgz",hwgz);
            map1.put("zfgjjys",zfgjjys);
            map1.put("zfggbtys",zfggbtys);
            map1.put("je",je);
            map1.put("hjwy",hjwy);
            map1.put("czbkwy",czbkwy);
            map1.put("jzzjwy",jzzjwy);

            list.add(map1);
        }
       /* String sqlCount = "select count(1) as count from uf_jingfei_version t,uf_zfggzcjfxqb t1 where t.lcjlsqjlid = t1.requestId " + str + ";";
        RecordSet rs2 = new RecordSet();
        rs2.executeQuery(sqlCount);
        rs2.next();
        log.info("查询数量SQL ： " + sql );
        Double total = Double.parseDouble(rs2.getString("count"));
        Double pageSizeDou = Double.parseDouble((pageSize));*/

        map.put("retcode","0");
        map.put("retmsg","查询成功！");
        /*map.put("pageNum",pageNum);
        map.put("pageSize",pageSize);
        map.put("total",Integer.parseInt(rs2.getString("count")));
        map.put("pages",Math.ceil(total/pageSizeDou));*/
        map.put("fromTable","uf_zfggzcjfxqb");
        map.put("list",list);
        log.info("======================================="+map.toString());
        return JSON.toJSONString(map);
    }
}
